//
//  Constants.h
//  HongYanNews
//  接口访问地址定义文件
//  Created by 123 on 14-7-8.
//  Copyright (c) 2014年 iMobile. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Constants : NSObject

//接口访问地址都写在此文件种 例如：

////banner
////正式服务器
//#define BASEURL @"http://122.0.64.139/jiatiyan/Home/"
////测试服务器
//#define URL_DOMAIN @"http://58.64.137.80:81/"
#define URL_DOMAIN @"http://202.105.182.114:83/"



/* 接口 */
//#define API_STR @"http://58.64.137.80:81/androidAPI/loginin.ashx"
#define API_STR @"http://202.105.182.114:83/androidAPI/loginin.ashx"

/* 参数模板 */
#define TEMPLATE_PARAMSTR @"{\"action\":\"%@\",\"params\":%@}"


// 用户Id
#define UID [[NSUserDefaults standardUserDefaults]objectForKey:@"userId"]
// 用户名
#define UNAME [[NSUserDefaults standardUserDefaults]objectForKey:@"username"]
//用户密码
#define UPWD_OLD [[NSUserDefaults standardUserDefaults]objectForKey:@"userpwd"]

// 图片占位符
#define PLACE_HODER_IMG [UIImage imageNamed:@"placeholder"]
#define STR_FOR_SPACE @""
// 内容图片占位符
#define CONTENTIMAGE_REPLACEMENT_CHARACTER @"】"


// gb2312转码
#define ENCODING_FOR_GB CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000)


// 本地操作视频存储位置
#define YinHang_Local_Video [[NSHomeDirectory() stringByAppendingPathComponent:@"/Library/Caches"] stringByAppendingPathComponent:@"yinhang.local.video"]

// 网络视频下载目录
#define YinHang_DownLoad_Video [[NSHomeDirectory() stringByAppendingPathComponent:@"/Library/Caches"] stringByAppendingPathComponent:@"yinhang.download.video"]




// html模板
// #define TEMPLATE_JAVASCRIPT_ON_FUNCTION_REPLACE @"on\\w+=\"[^\"]+\""

#define REG_EXPR_FOR_IMG_FOR_TAG @"<(IMG|img)[^>]+src=[\"\']([^>]+)[\"\'][^>]*>"
#define REG_EXPR_FOR_IMG_FOR_SRC @"src=[\'\"]?(.*?)([\'\"]|>|\\s+)"
#define REG_EXPR_FOR_HR_FOR_TAG @"<(HR|hr)[^>]+id=[\"\']([^>]+)[\"\'][^>]*>"
#define REG_EXPR_FOR_IFRAME_FOR_TAG @"<(IFRAME|iframe)[^>]+>*</(IFRAME|iframe)>"

//#define HTML_ATTR_ATTACH_IMG @" style=\"width:300px;height:250px\" "
#define HTML_ATTR_ATTACH_IMG @" style=\"width:300px;height:200px\" "

// 程序主色调
#define APP_COLOR [AOColorFormat colorWithHexString:@"#00a3d6"]
// 文字主色调
#define TEXT_COLOR [AOColorFormat colorWithHexString:@"#666666"]


#define DEFAULT_thumbImageWidth 260.0f
#define DEFAULT_thumbImageHeight 347.0f



// 检查系统
#define MAIN_VERSION [[[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:@"."][0] integerValue]

#define ios7 MAIN_VERSION >= 7 ? YES : NO

//屏幕尺寸适配相关
#define IPHONE5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)


//工程目录Documents
#define DOC_PATH [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]

//保存用户名密码目录
#define PATH_FOR_DOCUMENT NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]

#define UPPATH [PATH_FOR_DOCUMENT stringByAppendingPathComponent:@"userAndPwd.plist"]

//检查网络
+(bool)isExistenceNetwork;

@end
